<h1>Admins</h1>

<table>
  <tr>
    <th>Email</th>
    <th>Created At</th>
    <th></th>
    <th></th>
  </tr>

<% unapproved = 0 
   @admins.each do |admin| 
     unapproved += 1 unless admin.approved
%>
  <tr style="<%= !admin.approved ? "background: lightblue;" : "" %>">
    <td><%= admin.email %></td>
    <td><%= admin.created_at %></td>
    <td><%= link_to 'Destroy', admin, method: :delete, data: { confirm: 'Are you sure?' } %></td>
    <td><%= link_to 'Approve', "/admins/#{admin.id}/approve" %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to "Admins awaiting approval", :action => "index", :approved => "false" %>: <%= unapproved %>
